home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / Interfaces&Libraries / Interfaces / AIncludes / MacRuntime.a < prev    next >
Encoding:
Text File  |  1996-05-07  |  4.4 KB  |  117 lines  |  [TEXT/MPS ]

  1. ;  File MacRuntime.a
  2. ;
  3. ;  Copyright Apple Computer, Inc. 1994-1996
  4. ;  All rights reserved.
  5. ;
  6. ;  Include File for Accessing the MacRuntime Libraries
  7.  
  8. ;  Set CASE OBJECT to assure references to the names IMPORTed here link
  9. ;  properly.  The following statements restore the CASE setting to its
  10. ;  previous value.
  11.  
  12.     IF &TYPE('__INCLUDINGMACRUNTIME__') = 'UNDEFINED' THEN
  13. __INCLUDINGMACRUNTIME__    SET    1
  14.  
  15.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  16.     include 'ConditionalMacros.a'
  17.     ENDIF
  18.  
  19.     IF GENERATING68K THEN
  20.  
  21.             PRINT            Push,Off            ; save current print settings and turn it off
  22.             GBLC            &S%%%,&P%%%
  23. &S%%%        SETC            &Setting('CASE')    ; save current CASE setting
  24. &P%%%        SETC            &Setting('PRINT',1) ; and PRINT settings before we changed them
  25.  
  26.             MACRO
  27.             X%%%
  28.             GBLC            &S%%%,&P%%%         ; link references with previously defined variables
  29.             PRINT            Push,&P%%%            ; restore the previous PRINT settings
  30.             CASE            &S%%%                ; and restore the CASE setting
  31.             PRINT            POP                 ; restore the PRINT settings
  32.             ENDM
  33.  
  34.             PRINT            Pop                 ; restore the PRINT settings
  35.             CASE            OBJECT                ; all imported/exported names case significant
  36.  
  37. ;  MacRuntime Globals
  38.  
  39.             IMPORT            MacOSErr            ; 0 if no error, error value otherwise
  40.                                                 ; added from errors.a • rjd 941017
  41.             
  42.             IMPORT            StandAlone            ; a long, 0 if in shell, 1 if standalone
  43.             
  44.     IF (&TYPE('NURUNTIME') <> 'UNDEFINED') THEN
  45. _#StandAlone    DS.L        StandAlone
  46.     ENDIF
  47.  
  48. ;    MacRuntime Utility Routines
  49.  
  50. ;** pascal Boolean TrapAvailable (short TrapNumber);
  51.  
  52.             IMPORT            TRAPAVAILABLE        ; Determine if a Trap is available
  53.             
  54.  
  55.  
  56. ;    68K CFM Runtime and Shared Library Support Routines
  57. ;
  58. ; ****
  59. ; NOTE:     These Support Routines were made obsolete for E.T.O. #16 • rjd 941017
  60. ; ****
  61. ;
  62. ; NOTE:  To use these routines, you must define the symbol 'NURUNTIME' at
  63. ;         assembly time.
  64. ;
  65. ;    IF (&TYPE('NURUNTIME') <> 'UNDEFINED') THEN
  66. ;
  67. ;** LinkupQDGlobals is called from the default CFM init routine %__INIT.
  68. ;** Please Refer to FragLoad.h for the prototype of custom init routines.
  69. ;** If you create your own init routine you must call LinkupQDGlobals before
  70. ;** any other code you write (and that code MAY NOT call Quickdraw)
  71. ;**
  72. ;** LinkupQDGlobals purpose is to create a linked list of all the "per context" 
  73. ;** A5 Worlds in a given application context so that QuickDraw will find a 
  74. ;** "QD globals" pointer at A5+0 no matter which A5World is currently ref'd by A5.
  75. ;**
  76. ;** The linked list built by LinkupQDGlobals uses the lomem global CurrentA5
  77. ;** and builds the list thru the qd Globals pointers at A5+0, IF InitGraf() has
  78. ;** NOT yet been called; Otherwise LinkupQDGlobals just copies the value of the 
  79. ;** QuickDraw globals pointer (at the location pointed to by CurrentA5) into 
  80. ;** the A5+0; i.e. into the A5World of the code fragment containing LinkupQDGlobals.
  81. ;**
  82. ;** LinkupQDGlobals is and MUST REMAIN a staticly linked routine, called by the
  83. ;** init routine of each separate code fragment. It may not be exported or shared.
  84. ;**
  85. ;** LinkupQDGlobals will only return an error if it is called and the A5World
  86. ;** referenced by the lomem pointer CurrentA5 is NOT a NuRuntime A5World AND 
  87. ;** QuickDraw has NOT been initialized.  This condition can occur ONLY if an 
  88. ;** "old"/"Classic" 68K model application is attempting to use the CFM API directly.
  89. ;**
  90. ;** The routine BindQDGlobalsList must be called IMMEDIATELY before the application
  91. ;** initialization call of QuickDraw's InitGraf() routine, WITH THE SAME parameter 
  92. ;** passed to InitGraf.  BindQDGlobalsList resolves the linked list of A5Worlds
  93. ;** created by LinkupQDGlobals.  This will cause all the A5Worlds to have a valid
  94. ;** pointer at A5+0 to the same QuickDraw Globals.
  95. ;**
  96. ;** Shared Libraries that have "Global" sharing (i.e 1 copy of data in system heap)
  97. ;** must have customized Init Routines and probably will require a private copy of 
  98. ;** the quickdraw globals that are created manually and A5+0 initialized without
  99. ;** calling QuickDraw's InitGraf() IF such libraries are to call QuickDraw (directly
  100. ;** or indirectly) at all.  The most likely case of a "data only" globally shared 
  101. ;** fragment will not need to have an init routine that fixes up A5+0, since no code
  102. ;** will ever execute with A5 referencing its A5World.
  103. ;** 
  104. ;** pascal OSErr LinkupQDGlobals(void);
  105. ;** pascal void BindQDGlobalsList(void* globalPtr);
  106. ;** 
  107. ;
  108. ;            IMPORT            LINKUPQDGLOBALS
  109. ;            IMPORT            BINDQDGLOBALSLIST
  110. ;
  111.  
  112.     ELSE
  113.         aerror    'MacRuntime.a is a 68K only assembly file!'
  114.     ENDIF    ; ...GENERATING68K
  115.     
  116.     ENDIF
  117.